//
//  Result.swift
//  coin
//
//  Created by 刘泽 on 2017/12/14.
//  Copyright © 2017年 刘泽. All rights reserved.
//

import Foundation
import ObjectMapper


open class MessageModel : Mappable{

    public var message : String?


    required public init?(map: Map) {

    }
    public init() {
        
    }

    public func mapping(map: Map) {

        message <- map["msg"]

    }

}

open class ResultMsgModel : Mappable{
    public var data : String?

    public var message : String?

    public var code : String?


    required public init?(map: Map) {

    }

    public func mapping(map: Map) {

        data <- map["data"]
        message <- map["msg"]
        code <- map["code"]

    }
}

open class ResultModel<T : Mappable> : Mappable{
    
    public var data : T?
    
    public var msg : String?
    
    public var code : String?
    
    
    required public init?(map: Map) {
        
    }
    
    public func mapping(map: Map) {
        
        data <- map["data"]
        msg <- map["msg"]
        code <- map["code"]
        
    }
    
}

open class ResultListDataModel<T:Mappable> : Mappable{

    public var data : [T]?

    public var code : Int?

    public var message : Int?


    required public init?(map: Map) {

    }


    public func mapping(map: Map) {

        data <- map["data"]
        code <- map["code"]
        message <- map["msg"]

    }

}

open class ResultListModel<T:Mappable> : Mappable{
    
    public var records : [T]?
    
    public var current : Int?
    
    public var pages : Int?

    public var size : Int?
    
    public var total : Int?
    
    
    required public init?(map: Map) {
        
    }
    
    
    public func mapping(map: Map) {
        
        records <- map["records"]
        current <- map["current"]
        pages <- map["pages"]
        size <- map["size"]
        total <- map["total"]
        
    }
    
}


open class ResultStringModel : Mappable{
    
    public var data : String?
    
    public var message : String?
    
    public var code : String?
    
    
    required public init?(map: Map) {
        
    }
    
    public func mapping(map: Map) {
        
        data <- map["data"]
        message <- map["message"]
        code <- map["code"]
        
    }
    
}

open class ResultBoolModel : Mappable{

    public var data : Bool?

    public var message : String?

    public var code : String?


    required public init?(map: Map) {

    }

    public func mapping(map: Map) {

        data <- map["data"]
        message <- map["message"]
        code <- map["code"]

    }

}



open class ResultIntModel : Mappable{
    
    public var data : Int?
    
    public var message : String?
    
    public var code : String?
    
    
    required public init?(map: Map) {
        
    }
    
    public func mapping(map: Map) {
        
        data <- map["data"]
        message <- map["message"]
        code <- map["code"]
        
    }
    
}



